package com.tanhua.model.vo;

import com.tanhua.model.db.UserInfo;
import com.tanhua.model.mongo.Options;
import com.tanhua.model.mongo.PeachBlossomAudio;
import com.tanhua.model.mongo.Questions;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.beans.BeanUtils;

import java.util.List;
//试题的选项集合以及题目
@Data
@AllArgsConstructor
@NoArgsConstructor
public class QuestionsVo {

    private String id; //主键, 试题编号
    private String question;//题目
    private List<OptionsVo> options;//选项集合

    public static QuestionsVo init(List<OptionsVo> list, Questions questions) {
        QuestionsVo vo = new QuestionsVo();

        //设置试题vo数据
       vo.setId(questions.getId().toString());
       vo.setQuestion(questions.getQuestion());
       vo.setOptions(list);

        //返回数据
        return vo;
    }
}
